import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.print("请输入两个数的值：");
        int a= scan.nextInt();
        int b= scan.nextInt();
        int c=a%b;
        while (c!=0){
            a=b;
            b=c;
            c=a%b;
        }
        System.out.println("最大公约数是："+b);
    }
}